package demo3;


/**
 * @Author 12629
 * @Date 2022/4/6 20:03
 * @Description：
 */
interface IShape {

    /*//成员变量
    int a = 10;
    //成员方法
    default void func() {
        System.out.println("默认的方法！");
    }
    public static void staticFunc() {
        System.out.println("静态方法！");
    }*/
    void draw();
}

class Cycle implements IShape {
    @Override
    public void draw() {
        System.out.println("●");
    }
}
class Rect implements IShape {
    @Override
    public void draw() {
        System.out.println("♦");
    }
}

class Triangle implements IShape {
    @Override
    public void draw() {
        System.out.println("△");
    }
}

public class Test {

    public static void drawMap(IShape shape) {
        shape.draw();
    }

    public static void main(String[] args) {
        Cycle cycle = new Cycle();
        Rect rect = new Rect();
        Triangle triangle = new Triangle();
        drawMap(cycle);
        drawMap(rect);
        drawMap(triangle);
    }


    public static void main1(String[] args) {
        //IShape iShape = new IShape();
        /*IShape iShape = new A();
        iShape.draw();
        iShape.func();

        IShape.staticFunc();*/
    }
}
